package com.apphome.rbac.domain;

import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.apphome.dal.AbstractEntity;



/**
 * The persistent class for the t_roles_authorities database table.
 * 
 */
@Entity
@Table(name="t_roles_authorities")
public class RoleAuthority extends AbstractEntity {
	
	
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private Timestamp createTime;
	private Object enabled;
	private Timestamp lastupdateTime;
	private Role role;
	private List<AuthorityResource> authoritiesResources;

	public RoleAuthority() {
	}

	@Column(name="CREATE_TIME")
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}


	public Object getEnabled() {
		return this.enabled;
	}

	public void setEnabled(Object enabled) {
		this.enabled = enabled;
	}


	@Column(name="LASTUPDATE_TIME")
	public Timestamp getLastupdateTime() {
		return this.lastupdateTime;
	}

	public void setLastupdateTime(Timestamp lastupdateTime) {
		this.lastupdateTime = lastupdateTime;
	}

	//bi-directional many-to-one association to Role
	@ManyToOne
	@JoinColumn(name="ROLE_ID")
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}


	//bi-directional many-to-one association to AuthoritiesResource
	@OneToMany(mappedBy="rolesAuthority")
	public List<AuthorityResource> getAuthoritiesResources() {
		return this.authoritiesResources;
	}

	public void setAuthoritiesResources(List<AuthorityResource> authoritiesResources) {
		this.authoritiesResources = authoritiesResources;
	}

}